import pypandoc

# HTML 文件路径
html_file_path = 'https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/foreword.html'
# DOCX 文件路径
docx_file_path = 'output.docx'

# 使用 pandoc 进行转换
pypandoc.convert_file(html_file_path, docx_file_path, 'docx', outputfile='docx')